﻿const container = document.querySelector("#curr-time");
setInterval(() => {
    container.textContent = (new Date()).toLocaleString();
}, 1000);

(async function() {
    const arr = await window.chrome.webview.hostObjects.AHK;
    const len = await arr.getHostProperty("length"); // otherwise we get the Proxy object's length
    
    const first = await arr.push(arr, "of");
    
    // for (let item in arr.applyHostFunction("__enum")) {
    for (let i = 0; i < len; i++) {
        console.log(await arr.get(i));
    }
    
    console.log(first);
})();
